<template>
    <div style="position: relative;">
        <!-- 面包屑导航 -->
        <el-breadcrumb separator-class="el-icon-arrow-right" class="tit">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>{{ title }}</el-breadcrumb-item>
        </el-breadcrumb>
        <!-- 角色管理列表 -->
        <template>
            <el-table :data="tableData" style="width: 100%" border>
                <el-table-column prop="authName" label="权限名称" width="120">
                </el-table-column>
                <el-table-column prop="id" label="ID" width="50">
                </el-table-column>
                <el-table-column prop="level" label="权限等级" width="120">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.level==0" >等级一</el-tag>
                        <el-tag v-if="scope.row.level==1" type="success">等级二</el-tag>
                        <el-tag v-if="scope.row.level==2" type="info">等级三</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="path" label="地址" width="75">
                </el-table-column>
                <el-table-column prop="pid" label="来源于上一级" width="120">
                </el-table-column>
            </el-table>
        </template>
    </div>
</template>
<script>
import { GetRightts } from '@/api/roles';

export default {
    data() {
        return {
            title: null,
            tableData: []
        }
    },
    mounted() {
        this.title = sessionStorage.getItem('title')
        this.getdata()
    },
    methods: {
        async getdata() {
            let data = await GetRightts('list');
            this.tableData = data.data.data;
        }
    }
}
</script>